Skip to content

Update history repository#7365

Merged
miiu96 merged 10 commits into
feat/supernova-async-execfrom
update-db-lookup-ext-supernova
Oct 29, 2025
Merged

Update history repository#7365
miiu96 merged 10 commits into
feat/supernova-async-execfrom
update-db-lookup-ext-supernova

Conversation

@miiu96

@miiu96 miiu96 commented Oct 22, 2025

Copy link
Copy Markdown
Contributor

Reasoning behind the pull request

  • Update history repository to work also with execution results

Proposed changes

Testing procedure

Pre-requisites

Based on the Contributing Guidelines the PR author and the reviewers must check the following requirements are met:

  • was the PR targeted to the correct branch?
  • if this is a larger feature that probably needs more than one PR, is there a feat branch created?
  • if this is a feat branch merging, do all satellite projects have a proper tag inside go.mod?

@miiu96 miiu96 marked this pull request as ready for review October 23, 2025 11:43
Comment thread dblookupext/common.go Outdated

cachedIntermediateTxsMap, ok := cachedIntermediateTxs.(map[block.Type]map[string]data.TransactionHandler)
if !ok {
return make(map[string]data.TransactionHandler), make(map[string]data.TransactionHandler), nil

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not some type assertion error?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed

Comment thread dblookupext/common.go Outdated
}
cachedLogsSlice, ok := cachedLogs.([]*data.LogData)
if !ok {
return []*data.LogData{}, nil

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same question here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed

Comment thread dblookupext/common.go
return &block.Body{MiniBlocks: miniBlocks}, nil
}

func extractMiniBlocksHeaderHandlersFromExecResult(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps add a todo to reuse the method that was moved into common here: #7337

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added TODO

func TestGetIntermediateTxs(t *testing.T) {
t.Parallel()

t.Run("getIntermediateTxs cannot find in cache", func(t *testing.T) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these inner tests can have t.Parallel()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added for all testcases

Comment thread process/block/baseProcess.go Outdated
}

// cleanup intra shard mini-blocks
bp.dataPool.MiniBlocks().Remove(headerHash)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it this correct? calling it with the header hash for the miniblocks cache?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, because on line 841 in file shardBlockProposal.go I save a slice on intra shard miniblocks with key header hash. Also refactored the part with cleanup, moved in another place.

func TestRecordHeaderV3(t *testing.T) {
t.Parallel()

t.Run("record block v3 should work no execution results", func(t *testing.T) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

parallel run for inner tests?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

Comment thread process/block/baseProcess.go Outdated
Comment on lines +2517 to +2521
executionResultHeaderHash := baseExecutionResult.GetHeaderHash()
// cleanup all intra shard miniblocks
bp.dataPool.MiniBlocks().Remove(executionResultHeaderHash)
// cleanup all log events
bp.dataPool.PostProcessTransactions().Remove(common.PrepareLogEventsKey(executionResultHeaderHash))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we can extract this into a separate function, and call it from CommitBlock, to have it called explicitly

  • there is already cleanupPools function that might be correlated with this

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

refactored

Comment on lines +840 to 846
intraMiniBlocks := sp.txCoordinator.GetCreatedInShardMiniBlocks()
err = sp.cacheIntraShardMiniBlocks(headerHash, intraMiniBlocks)
if err != nil {
return nil, err
}

err = sp.cacheExecutedMiniBlocks(sanitizedBodyAfterExecution, miniBlockHeaderHandlers)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so intra shard miniblocks are not included in the call from L846?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no because, there are cached miniblocks from sanitezedBody

@miiu96 miiu96 merged commit b0cd2e6 into feat/supernova-async-exec Oct 29, 2025
8 of 9 checks passed
@miiu96 miiu96 deleted the update-db-lookup-ext-supernova branch October 29, 2025 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants